package jtk.project4.fleet.field;

import jtk.project4.fleet.domain.TireInv;
import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.FormLayout.Resize;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.TextField;

public class StatisticsAddEditTireToInventoryField extends GroupControl<TireInv>{
	private TextField totalMiField;
	private TextField totalServiceField;
	private TextField costPerField;
	private TextField treadDepthField;
	
	public StatisticsAddEditTireToInventoryField(String bindID){
		setTitle("header.Statistics");
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	private void createFields(){
		//Kalender
		/*Purchase_DateField = new CalendarControl ("Purchase Date", 20);
		Purchase_DateField.setFormat(new SimpleDateFormat ("Date.Format"));
		Purchase_DateField.showYearSpinner(true);*/
		
		//SpinnerField
		
		totalMiField = new TextField ("", 20);
		//totalMiField.setRequired(true);
		
		totalServiceField = new TextField ("tCost", 20);
		//totalServiceField.setRequired(true);
		
		costPerField = new TextField ("cpm", 20);
		//costPerField.setRequired(true);
		
		treadDepthField = new TextField ("treadDepth", 20);
		//treadDepthField.setRequired(true);
	}
	
	private void createLayout(){
		setLayout(new FormLayout())
		.addLabel("label.Total Mi/Km/Hr").addField(totalMiField, Resize.HORIZONTAL)
		.addRow()
		.addLabel("label.Total Service Cost").addField(totalServiceField, Resize.HORIZONTAL)
		.addRow()
		.addLabel("label.Cost Mi/Hr/Km").addField(costPerField, Resize.HORIZONTAL)
		.addRow()
		.addLabel("label.Tread Depth").addField(treadDepthField, Resize.HORIZONTAL);
	}
}
